import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";
import func from "@/utils/func";

//查询订单基础配置接口:
export async function getOrderRulesOp() {
	return request(`/new-common/baseConfig/getBaseConfig`);
}

//更新订单基础配置
export async function updateOrderRulesOp(params) {
	return request(`/new-common/baseConfig/update`, {
		method: "POST",
		data: params
	});
}

//查询订单合并配置
export async function getMergeConfigOp() {
	return request(`/new-common/mergeConfig/getMergeConfig`);
}

//修改订单合并配置
export async function updateMergeConfigOp(params) {
	return request(`/new-common/mergeConfig/update`, {
		method: "POST",
		data: params
	});
}

//用户平台店铺分页
export async function ecStoreListPageOp(params) {
	return request(`/blade-goods/newSystem/ecStore/list/page`, {
		method: "POST",
		data: params
	});
}

//更新店铺自动合单状态
export async function updateMergeOrderStatusOp(params) {
	return request(`/blade-goods/newSystem/ecStore/updateMergeOrderStatus?${stringify(params)}`);
}

//订单自动审核列表
export async function notAutoReviewStrategyList(params) {
	return request(`/new-common/notAutoReviewStrategy/list?${stringify(params)}`);
}

//平台店铺下拉列表   支持模糊搜索 :storeName
export async function queryShopList(params) {
	return request(`/blade-goods/ecstore/list?${stringify(params)}`);
}

//新增订单自动审核
export async function saveNotAutoReviewStrategyOp(params) {
	return request(`/new-common/notAutoReviewStrategy/save`, {
		method: "POST",
		data: params
	});
}

//删除订单自动审核
export async function deleteNotAutoReviewStrategy(params) {
	return request(`/new-common/notAutoReviewStrategy/delete?${stringify(params)}`, {
		method: "POST"
	});
}

//修改订单自动审核状态
export async function updateStatusNotAutoReviewStrategy(params) {
	return request(`/new-common/notAutoReviewStrategy/updateStatus`, {
		method: "POST",
		data: params
	});
}

//订单自动审核状态详情
export async function notAutoReviewStrategyOp(params) {
	return request(`/new-common/notAutoReviewStrategy/getById?${stringify(params)}`);
}

//修改订单自动审核状态
export async function updateNotAutoReviewStrategyOp(params) {
	return request(`/new-common/notAutoReviewStrategy/update`, {
		method: "POST",
		data: params
	});
}

//获取快递列表
export async function expressStrategyList(params) {
	return request(`/new-common/expressStrategy/list?${stringify(params)}`);
}

//修改状态
export async function expressStrategyStatus(params) {
	return request(`/new-common/expressStrategy/updateStatus`, {
		method: "POST",
		data: params
	});
}

//删除订单自动审核
export async function deleteExpressStrategyOp(params) {
	return request(`/new-common/expressStrategy/delete?${stringify(params)}`, {
		method: "POST"
	});
}

//获取快递列表
export async function queryExpressList(params) {
	return request(`/blade-logistics/expresskxerp/expressKv?${stringify(params)}`);
}

//仓库下拉选择
export async function warehouseSelectList(params) {
	return request(`/zjf-wms/kx/warehouse/selectList?${stringify(params)}`);
}

//新增智能快递
export async function expressStrategySaveOp(params) {
	return request(`/new-common/expressStrategy/save`, {
		method: "POST",
		data: params
	});
}

//智能快递详情
export async function expressStrategyGetById(params) {
	return request(`/new-common/expressStrategy/getById?${stringify(params)}`);
}

//修改智能快递
export async function updateExpressStrategyOp(params) {
	return request(`/new-common/expressStrategy/update`, {
		method: "POST",
		data: params
	});
}

//智能包装列表
export async function packagingStrategyList(params) {
	return request(`/new-common/packagingStrategy/list?${stringify(params)}`);
}

//查询包装赠品明细 type:1赠品 2 包装 3 云仓严选包装 4:京东仓包装 5:纺支宝赠品 6:纺支宝包装
export async function getPackageDataOp(params) {
	return request(`/blade-goods/packagingGifts/getPage?${stringify(params)}`);
}

//新增智能包装
export async function packagingStrategySaveOp(params) {
	return request(`/new-common/packagingStrategy/save`, {
		method: "POST",
		data: params
	});
}

//修改智能包装状态
export async function updateStatusSackagingStrategyOp(params) {
	return request(`/new-common/packagingStrategy/updateStatus`, {
		method: "POST",
		data: params
	});
}

//删除订单自动审核
export async function deletePackagingStrategyOp(params) {
	return request(`/new-common/packagingStrategy/delete?${stringify(params)}`, {
		method: "POST"
	});
}

//智能包装详情
export async function packagingStrategyGetById(params) {
	return request(`/new-common/packagingStrategy/getById?${stringify(params)}`);
}

//修改智能包装
export async function updatePackagingStrategyOp(params) {
	return request(`/new-common/packagingStrategy/update`, {
		method: "POST",
		data: params
	});
}

//订单智能标签列表
export async function labelStrategyList(params) {
	return request(`/new-common/labelStrategy/list?${stringify(params)}`);
}

//查询异常
export async function errorConfigList(params) {
	return request(`/new-common/errorConfig/list?${stringify(params)}`);
}

//新增智能标签
export async function labelStrategySaveOp(params) {
	return request(`/new-common/labelStrategy/save`, {
		method: "POST",
		data: params
	});
}

//修改智能标签状态
export async function updateStatusLabelStrategyOp(params) {
	return request(`/new-common/labelStrategy/updateStatus`, {
		method: "POST",
		data: params
	});
}

//删除智能标签状态
export async function deleteLabelStrategyOp(params) {
	return request(`/new-common/labelStrategy/delete?${stringify(params)}`, {
		method: "POST"
	});
}

//智能标签状态详情
export async function labelStrategyGetById(params) {
	return request(`/new-common/labelStrategy/getById?${stringify(params)}`);
}

//修改智能包装
export async function updateLabelStrategyOp(params) {
	return request(`/new-common/labelStrategy/update`, {
		method: "POST",
		data: params
	});
}

//获取异常原因
export async function getErrorReasonOp(params) {
	return request(`/new-common/errorConfig/list?${stringify(params)}`);
}


//批量修改异常
export async function batchUpdatErrorList(params) {
	return request(`/new-common/errorConfig/batchUpdate`, {
		method: "POST",
		data: params
	});
}

//查询京东云仓
export async function queryJdStoreWarehouse(params) {
	return request(`/new-common/jdStoreWarehouse/config/queryList?${stringify(params)}`);
}

//修改京东云仓
export async function updateJdStoreWarehouse(params) {
	return request(`/new-common/jdStoreWarehouse/config/update`, {
		method: "POST",
		data: params
	});
}

// 查询物流回传
export async function getBackflowConfig(params) {
	return request(`/new-common/logisticsbackflowremarkconfig/getConfig?${stringify(params)}`);
}

// 修改物流回传

export async function updateBackflowConfig(params) {
	return request(`/new-common/logisticsbackflowremarkconfig/update`, {
		method: "POST",
		data: params
	});
}